<template>
	<view class="content padding" v-if="pageShow">
		<!-- 商品信息 -->
		<view class="margin_top padding border_2 ffffff">
			<view class="flexbetween xiahuax margin_top">
				<view class="shilitu">
					<image :src="dataAll.service_info.image_text" mode="widthFix"></image>
				</view>
				<view class="" style="width: 74%;">
					<view class="yihang text_a color_san">{{dataAll.service_info.sku.name}}</view>
					<view class="flexbetween margin_top5">
						<view class="qianshu">¥{{dataAll.service_info.sku.price}}</view>
						<view class="shuliang">X1</view>
					</view>
				</view>
			</view>
		</view>
		<view class="margin_top padding ffffff border_2 flexleft">
			<image class="shopImg margin_right2" :src="dataAll.service_user.avatar" mode="widthFix"></image>
			<view class="color_ling text_six">{{dataAll.service_user.nickname}}</view>
		</view>
		<!-- 备注 -->
		<view class="margin_top padding border_2 ffffff">
			<view class="color_san text_w">备注</view>
			<view class="margin_top">
				<input class="text_g" type="text" placeholder="请输入留言信息给卖家"
					placeholder-style="color: #999999;font-size: 30rpx;" v-model="remarks">
			</view>
		</view>
		<!-- 支付提示 -->
		<view class="margin_top5" style="padding-bottom: 100rpx;">
			<u-parse :content="shopInfo.buy_rule"></u-parse>
		</view>
		<!-- 底部 -->
		<view class="footerBox padding ffffff flexbetween">
			<view>
				<text class="color_san text_g">合计：</text>
				<text class="price">¥{{dataAll.total_price}}</text>
			</view>
			<view class="payment" @click="goPayment">立即支付</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listid: "",
				fid: "",
				dataAll:{},
				remarks:"",
				shopInfo:{},//支付提示
				pageShow:false
			}
		},
		async onLoad(options) {
			this.fid = options.fid
			this.listid = options.id
			this.init()
			let res=await this.initApp()
			this.shopInfo=res.data
		},
		methods: {
			init(){
				httpRequest.request('/api/service_order/order_show', 'GET', {
					service_id: this.fid,
					service_sku_id: this.listid,
				}).then(res => {
					this.dataAll = res.data
					this.pageShow=true
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			goPayment() { //立即支付
				let data = {
					service_id:this.fid,
					service_sku_id:this.listid,
					remarks:this.remarks,
					total_price:this.dataAll.total_price
				}
				console.log(data,"999");
				uni.redirectTo({
					url: "/pages_index/payment?msg3=" + encodeURIComponent(JSON.stringify(data))
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		padding-bottom: 110rpx;
	}

	.imgShop {
		width: 26.62rpx;
		height: 24rpx;
	}

	.shopImg {
		width: 80rpx;
		height: 80rpx;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		border: 1rpx solid #F1F1F1;
	}

	.xiahuax {
		padding-bottom: 30rpx;
		border-bottom: 1rpx solid rgba(153, 153, 153, .1);
	}

	.shilitu {
		width: 134rpx;
		height: 128rpx;
		border-radius: 14rpx;
		overflow: hidden;

		image {
			width: 100%;
			height: 100%;
			border-radius: 14rpx;
		}
	}

	.shuliang {
		font-size: 26rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #999999;
	}

	.qianshu {
		font-size: 30rpx;
		font-family: DIN Next LT Pro-Bold, DIN Next LT Pro;
		font-weight: bold;
		color: rgba(243, 39, 28, 1);
	}

	.footerBox {
		width: 100%;
		position: fixed;
		left: 0;
		bottom: 0;
		box-sizing: border-box;
	}

	.price {
		font-size: 36rpx;
		font-family: DIN-Bold, DIN;
		font-weight: bold;
		color: #F3271C;
	}

	.payment {
		width: 250rpx;
		height: 76rpx;
		line-height: 76rpx;
		text-align: center;
		background: #F3271C;
		border-radius: 120rpx 120rpx 120rpx 120rpx;
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
	}
</style>